package cn.vc.basicmodule.rabbitmqconfig;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ShopRabbitMqConfig {
    public static final String Background_BlueV = "background_bluev";

    public static final String SHOP_DIRECT_EXCHANGE = "shop.direct";
    public static final String SHOP_APPLY_QUEUE = "shop.queue.apply";
    public static final String SHOP_PUBLISH_QUEUE = "shop.queue.publish";
    public static final String SHOP_APPLY_KEY = "apply";
    public static final String SHOP_PUBLISH_KEY = "publish";

    public static final String User_SELECT = "user_select";

    @Bean
    public Queue bluev() {
        return new Queue("background_bluev");
    }

    @Bean
    public Queue shop() {
        return new Queue("background_shop");
    }

    @Bean
    public Queue userSelect() {
        return new Queue("user_select");
    }

    @Bean
    public DirectExchange shopDirectExchange() {
        return new DirectExchange("shop.direct", true, false);
    }
    /**
     * <h1>商铺认证申请</h1>
     */
    @Bean
    public Queue shopApplyQueue() {
        return QueueBuilder.durable("shop.queue.apply").build();
    }
    @Bean
    public Binding shopApplyBinding() {
        return BindingBuilder.bind(shopApplyQueue()).to(shopDirectExchange()).with("apply");
    }
    /**
     * <h1>商铺认证通过</h1>
     */
    @Bean
    public Queue shopPublishQueue() {
        return QueueBuilder.durable("shop.queue.publish").build();
    }
    @Bean
    public Binding shopPublishBinding() {
        return BindingBuilder.bind(shopPublishQueue()).to(shopDirectExchange()).with("publish");
    }
}
